package com.guyaogg.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.guyaogg.common.to.mq.SeckillOrderTo;
import com.guyaogg.common.utils.PageUtils;
import com.guyaogg.gulimall.order.entity.OrderEntity;
import com.guyaogg.gulimall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author guyao
 * @email 3039744913@qq.com
 * @date 2021-10-08 17:27:24
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页返回要用的数据
     * @return
     */
    OrderConfirmVO confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单方法
     * @param vo
     * @return
     */
    SubmitOrderResponseVO submitOrder(OrderSubmitVO vo);

    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity order);

    /**
     * 获取当前订单的支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    String handlePayResult(PayAsyncVo vo);

    void createSeckillOrder(SeckillOrderTo seckillOrder);

}

